package com.cy.pj.sys.dao;

import com.cy.pj.sys.pojo.SysLog;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository//持久层实现类特有的备注
public class SysLogLmpL implements SysLogDao{
@Autowired
private SqlSession sqlSession;

    @Override
    public List<SysLog> selectLogs(SysLog sysLog) {
        //用api找到映射文件的命名空间-全局限定名id,username,operation,method,params,time,status,error,createdtimeid,username,operation,method,params,time,status,error,createdtime
String a=this.getClass().getInterfaces()[0].getName();
        String b=Thread.currentThread().getStackTrace()[1].getMethodName();
String name=a+"."+b;
//用sqlSession通过限定名建立数据库连接
List<SysLog> list=sqlSession.selectList(name,sysLog);
        return list;
    }

    @Override
    public SysLog selectById(Long id) {
        return null;
    }

    @Override
    public int insertLog(SysLog sysLog) {
        return 0;
    }

    @Override
    public int deleteLogs(Long... id) {
        return 0;
    }
}
